import { useEffect } from "react";
import { Project } from "screens/project-list/list";
import { useAsync } from "./use-async";
import { useHttp } from "utils/http";
import { cleanObject, useDebounce } from "utils";
export const useProject = (param?: Partial<Project>) => {
    const client = useHttp();
    // const debouncedParam = useDebounce(param, 200);
    const { run, ...result } = useAsync<Project[]>();
  useEffect(() => {
    run(client("projects", { data: cleanObject(param || {}) }));
    //eslint-disable-next-line react-hooks/exhaustive-deps
  }, [param]);

  return result
}